﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace CodeGenBL.Function
{
    public class Validation
    {
        public static bool isInvalidCharacters(string path)
        {
            bool invalidCharacters = false;

            if (string.IsNullOrEmpty(path) == false)
            {
                char[] invalidChars = Path.GetInvalidFileNameChars();

                foreach (char invalidChar in invalidChars)
                {
                    if (path.Contains(invalidChar.ToString()))
                    {
                        invalidCharacters = true;
                        break;
                    }
                }
            }
            return invalidCharacters;
        }


        public static bool isInvalidPathName(string path)
        {
            bool invalidCharacters = false;

            if (string.IsNullOrEmpty(path) == false)
            {
                char[] invalidPathChars = Path.GetInvalidPathChars();//Path.GetInvalidFileNameChars();

                foreach (char invalidChar in invalidPathChars)
                {
                    if (path.Contains(invalidPathChars.ToString()))
                    {
                        invalidCharacters = true;
                        break;
                    }
                }
            }
            return invalidCharacters;
        }



    }
}